﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ServicosConsulta.aspx.cs" Inherits="NewTierra.Pages.Servicos.ServicosConsulta" %>

<!DOCTYPE html>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" tagprefix="ajaxToolkit"%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor" TagPrefix="cc1" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

      <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />
      <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
      <script type="text/javascript" src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>

      <link href="~/Styles/EstiloGeral.css" rel="stylesheet" type="text/css" />

    <style type="text/css">
        #servicos
        {
            height: 688px;
            width: 1330px;
        }
        #ServicosForm
        {
            width: 1302px;
            height: 652px;
        }
        #ServicosForm .FiltrosServicos
        {
            border: 1px solid #999;
            margin-bottom: 5px;
            padding: 10px;
            background-color: #EEE;
            height: 135px;
            background: #FAFAFA;
	        color: #666;
        }
        #ServicosForm .ServCadastro
        {
            height: 305px;
            float: left;
            width: 366px;
        }
        #ServicosForm .ServEsq
        {
            height: 588px;
            float: left;
            width: 403px;
        }
        #ServicosForm .ServDir
        {
            height: 503px;
            float: left;
            width: 817px;
            margin-left: 20px;
        }
        #ServicosForm .BotoesServico
        {
            height: 51px;
            float: left;
            width: 365px;
        }
        #SetSupplier
        {
            height: 606px;
        }
        .InfoLongServico
        {
            width: auto;
            height: 330px;
        }
        .InfoShortServico
        {
            width: auto;
            height: 330px;
        }
        .FiltroTipoServico
        {
            height: 55px;
            width: 245px;
        }
        .FiltroTipoServico .FiltroTipoServico_tipo
        {
            height: 35px;
            margin-top:6px;
            float: left;
        }
        .FiltroTipoServico .FiltroTipoServico_categ
        {
            height: 32px;
            margin-left: 5px;
            margin-top:6px;
            float: left;
        }
        .AddInfoVoucher
        {
            width: 827px;
            float: left;
            height: 133px;
        }
        .addInfoOperador
        {
            width: 373px;
            float: left;
        }
        .AddInfoCliente
        {
            width: 445px;
            float: left;
            margin-left: 10px;
        }
        #Operador
        {
            width: 840px;
            height: 326px;
        }
        .ServicoFormularioCrud
        {
            height: 413px;
            padding: 5px;
            display:inline;
	        float: left;
	        position: relative;
            border:1px solid #E6E6E6;
	        background: #FAFAFA;
	        color: #666;
        }
        .FiltroStatus_Cidade
        {
            width: 380px;
        }
        .FiltroStatus_Cidade .FiltroStatus
        {
            width: 88px;
            float: left;
        }
        .FiltroStatus_Cidade .FiltroCidade
        {
            width: 265px;
            float: left;
        }
    </style>

</head>
<body>
    
    <script type="text/javascript">
        function CallServerServicos() {
            document.getElementById('<%= btnFiltroNomeServicos.ClientID %>').click();
         }

         function OpenInfos(siteInfos) {
             var home = siteInfos;
             javascript: window.open(home);
         }

         function AbrirPopUp(url, title, w, h) {
             var left = (screen.width / 2) - (w / 2);
             var top = (screen.height / 2) - (h / 2);
             return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left + '');
         }

         function ShowIcon() {
             var e = document.getElementById("processing");
             e.style.visibility = (e.style.visibility == 'visible') ? 'hidden' : 'visible';
         }
    </script>

    <form id="formulario" runat="server">
        
        <asp:ScriptManager ID="ScriptManagerServico" runat="server">
        </asp:ScriptManager>

    <div id="servicos">
        
        <h2 class="titulo">Serviços</h2>
            <hr />
        <asp:UpdatePanel ID="UpdatePanelServicos" runat="server" RenderMode="Inline">
            <ContentTemplate>

                 <div id="ServicosForm">
                     <fieldset id="SetServico">
                         <legend><h3 style="margin-bottom: 0px">Serviço</h3></legend>
                         <div class="ServEsq">
                             <div class="FiltrosServicos radius">

                                 <asp:TextBox ID="txtServicos" runat="server" placeholder="Informe o nome do serviço." Width="340px" MaxLength="50"></asp:TextBox>
                                 
                                 <asp:AutoCompleteExtender 
                                 ID="AutoCompleteExtenderServicos" 
                                 runat="server" 
                                 CompletionInterval="100" 
                                 DelimiterCharacters="" 
                                 EnableCaching="False" 
                                 Enabled="True"
                                 MinimumPrefixLength="1" 
                                 OnClientItemSelected="CallServerServicos" 
                                 OnClientPopulated="ShowIcon"
                                 OnClientPopulating="ShowIcon" 
                                 ServiceMethod="SearchServicos" 
                                 TargetControlID="txtServicos" ServicePath="">
                                 </asp:AutoCompleteExtender>
                                 
                                 <img id="processing" alt="load" style="visibility:hidden" src="../../images/ajax-loader.gif" />
                                 
                                 <asp:Button ID="btnFiltroNomeServicos" style = "display:none" runat="server" OnClick="CarregarServicoNome"/>
                                 <br /><br />

                                 <div class="FiltroTipoServico">

                                     <div class="FiltroTipoServico_tipo">
                                         <asp:Label runat="server" ID="lblTipoServicosFiltroTXT" Text="Tipo Serviço:" /> <br />
                                         <asp:DropDownList ID="DDTipoServicoFiltro" OnSelectedIndexChanged="DDTipoServicoFiltro_SelectedIndexChanged" runat="server" 
                                            AppendDataBoundItems="True" AutoPostBack="True" >
                                         </asp:DropDownList>
                                     </div>

                                     <div class="FiltroTipoServico_categ">
                                         <asp:Label runat="server" ID="lblTipoServicosCategFiltroTXT" Text="Categoria:" /> <br />
                                         <asp:DropDownList ID="ddlTipoServicoCategFiltro" OnSelectedIndexChanged="DDTipoServicoCategFiltro_SelectedIndexChanged" runat="server" 
                                           AutoPostBack="True" >
                                         </asp:DropDownList>
                                     </div>

                                 </div>

                                 <div class="FiltroStatus_Cidade">

                                     <div class="FiltroStatus">
                                         <asp:Label runat="server" ID="lblStatusFiltroTXT" Text="Status:" /> <br />
                                         <asp:DropDownList ID="DDStatusFiltro" OnSelectedIndexChanged="DDStatusFiltro_SelectedIndexChanged" runat="server" AutoPostBack="True" 
                                            AppendDataBoundItems="True">
                                         </asp:DropDownList>
                                     </div>

                                     <div class="FiltroCidade">
                                         <asp:Label runat="server" ID="lblCidadeServicoFiltroTXT" Text="Cidade:" /> <br />
                                         <asp:DropDownList ID="ddlCidadeServicoFiltro" OnSelectedIndexChanged="DDCidadeServicoFiltro_SelectedIndexChanged" runat="server" AutoPostBack="True" 
                                         AppendDataBoundItems="True">
                                         </asp:DropDownList>
                                     </div>
                                 </div>

                                </div>

                             <div class="ServicoFormularioCrud radius">

                                 <h2 class="headline radius"><asp:Label ID="lblServicoNomeTituloTXT" runat="server" Text="" /></h2>

                                <div class="ServCadastro">

                                        <asp:TextBox ID="txtCodServico"  runat="server" style="display: none;"/>
                                        
                                    <p class="paragrafo">
                                        <asp:Label ID="lblNomeServicoTXT" runat="server" Text="Nome:"></asp:Label><br />
                                        <asp:TextBox ID="txtNomeServico"  runat="server" Width="300px" MaxLength="50"/>
                                        <asp:RequiredFieldValidator 
                                        ID="RqFieldNomeServico" 
                                        runat="server" 
                                        ControlToValidate="txtNomeServico" 
                                        ErrorMessage="*" 
                                        ValidationGroup="Salvar" 
                                        ToolTip="Informe um nome."></asp:RequiredFieldValidator>
                                    </p>

                                    <p class="paragrafo">
                                        <asp:Label ID="lblStatusServicoTXT" runat="server" Text="Status:"></asp:Label><br />
                                        <asp:DropDownList ID="ddlStatusServicos" runat="server"></asp:DropDownList>
                                    </p>

                                    <p class="paragrafo">
                                        <asp:Label ID="lblTipoServicoTXT" runat="server" Text="Tipo:"></asp:Label><br />
                                        <asp:DropDownList ID="ddlTipoServico" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlTipoServico_SelectedIndexChanged">
                                        </asp:DropDownList>
                                     </p>

                                     <p class="paragrafo">
                                        <asp:Label ID="lblTipoServicoCategTXT" runat="server" Text="Categoria:"></asp:Label><br />
                                        <asp:DropDownList ID="ddlTipoServicoCateg" runat="server">
                                        </asp:DropDownList>
                                     </p>

                                     <p class="paragrafo">
                                        <asp:Label ID="lblPaisServicoTXT" runat="server" Text="Pais:"></asp:Label><br />
                                        <asp:DropDownList ID="ddlPaisServicos" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlPaisServicos_SelectedIndexChanged"></asp:DropDownList>
                                     </p>

                                     <p class="paragrafo">
                                        <asp:Label ID="lblCidadeServicoTXT" runat="server" Text="Cidade:"></asp:Label><br />
                                        <asp:DropDownList ID="ddlCidadeServicos" runat="server">
                                        </asp:DropDownList>
                                     </p>

                                </div>

                                 <div class="BotoesServico"> 
                                     <asp:Button ID="btnNovoServico" runat="server" Text="Salvar" CssClass="btnsGeral" OnClick="CadastrarServico"  ValidationGroup="Salvar"  />
                                     <asp:Button ID="btnAtualizarServico" runat="server" CssClass="btnsGeral" OnClick="AtualizarServico" Text="Atualizar" ValidationGroup="Salvar"  />
                                     <asp:Button ID="btnExcluirServico" runat="server" CssClass="btnsGeral" OnClick="ExcluirServico" Text="Excluir" OnClientClick="return confirm('Excluindo esse serviço, todos as fotos e infos do mesmo também serão excluídas. Confirma?');" />
                                     <asp:Button ID="btnLimparServico" runat="server" CssClass="btnsGeral" OnClick="LimparServico" Text="Limpar" /> <br />
                                     <asp:Label ID="lblMsgCadServicos" runat="server" Font-Bold="True"></asp:Label>
                               </div>  

                             </div>

                         </div>

                         <div class="ServDir">
                        
                          <asp:Panel ID="PanelbtnsServico"  runat="server" Visible="false">
                             <input id="btnShowAddFotoServico" class="btnsGeral" value="Add Fotos" onclick="AbrirPopUp('AddFoto_Servico.aspx', 'Fotos', '790', '390')" type="button" />
                             <input id="btnShowInfoServico" class="btnsGeral" value="Info Serviço" onclick="OpenInfos('InfoServico.aspx')" type="button" />   
                          </asp:Panel>
                                 <br /><br /><br />

                             <asp:TabContainer ID="TabContainerInfos" runat="server"  Width="852px" Height="330px" ActiveTabIndex="0" BorderWidth="0px" BorderStyle="None">
                                 <asp:TabPanel ID="TabInfoLong" runat="server" HeaderText="Descrição"><ContentTemplate><div class="InfoLongServico"><cc1:Editor ID="EditorInfoLongServicos" runat="server" NoUnicode="true" /></div></ContentTemplate></asp:TabPanel>
                                 
                             <asp:TabPanel ID="TabInfoShort" runat="server" HeaderText="Descrição Curta"><ContentTemplate><div class="InfoShortServico"><cc1:Editor ID="EditorInfoShortServicos" runat="server" NoUnicode="true" /></div></ContentTemplate></asp:TabPanel>
                            
                                  <asp:TabPanel ID="TabOperador" runat="server" HeaderText="Descrição Operador"><ContentTemplate><div id="Operador"><div class="addInfoOperador"><asp:Label ID="lblRemarksServicosTXT" runat="server" Text="Remarks" /><br /><asp:TextBox ID="txtremarks" runat="server" Height="180px" TextMode="MultiLine" 
                                                    Width="360px" /></div><div class="AddInfoCliente"><asp:Label ID="lblInfoClienteServicosTXT" runat="server" Text="Infos do Cliente" /><br /><asp:TextBox ID="txtInfoCliente" runat="server" Height="180px" TextMode="MultiLine" 
                                                    Width="430px" /></div><div class="AddInfoVoucher"><asp:Label ID="lblInfoVoucherServicosTXT" runat="server" Text="Infos do Voucher" /><br /><asp:TextBox ID="txtInfoVoucher" runat="server" Height="85px" TextMode="MultiLine" 
                                                    Width="811px" /></div></div></ContentTemplate></asp:TabPanel>

                             </asp:TabContainer>
                         </div>

                     </fieldset> 

                 </div>


                </ContentTemplate>
            </asp:UpdatePanel>

        <!-- Área de Pre-Carregamento -->
    <div id="UpdateProgress" 
            style="position:absolute; z-index:1; left: 50%; top: 50%;">
        <asp:UpdateProgress ID="preLoading" runat="server"
            AssociatedUpdatePanelID="UpdatePanelServicos">
            <ProgressTemplate>
            
                <asp:Image ID="imgLoading" runat="server"
                    ImageUrl="~/Images/ajax-loaderG.gif"/>

            </ProgressTemplate>
        </asp:UpdateProgress>   
        </div>

    </div>


    </form>
</body>
</html>
